<%@page contentType="text/html; charset=UTF-8"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="java.util.*" %>


<%@page import="orest.common.util.Tools"%>
<%@page import="orest.common.valueobject.NeedForAchieveVal"%>


<%@page import="orest.common.dao.NeedForAchieveDao"%>
<%@page import="orest.common.util.IDGenerator"%>
<%
	String path = request.getContextPath();
    request.setCharacterEncoding("gbk");
    int i=0;
    Tools tool = new Tools();
    boolean  results = true;
    NeedForAchieveDao  needdao = new NeedForAchieveDao();
    NeedForAchieveVal  NeedObj = null;
    
    String title = request.getParameter("title")==null?"":request.getParameter("title");
    String keywords = request.getParameter("keywords")==null?"":request.getParameter("keywords");
    String item_16 = request.getParameter("item_16")==null?"":request.getParameter("item_16");
    String newenergyclass = request.getParameter("NewEnergyClass")==null?"":request.getParameter("NewEnergyClass");
    String needreason[] = request.getParameterValues("NeedReason");
    String needreasons = "";
    for(i=0;i<needreason.length;i++){
        needreasons = needreasons+needreason[i]+";";
    }
    
    String cooperate[] = request.getParameterValues("Cooperate");
    String cooperates = "";
    for(i=0;i<cooperate.length;i++){
        cooperates = cooperates + cooperate[i]+";";
    }
        
    String planinvest = request.getParameter("PlanInvest")==null?"":request.getParameter("PlanInvest");
  
    
   
       
     String techsatus = request.getParameter("techsatus")==null?"":request.getParameter("techsatus");
     
      String techneed = request.getParameter("techneed")==null?"":request.getParameter("techneed");
        
 String needertype  = request.getParameter("needertype")==null?"":request.getParameter("needertype");
 
   
  String unitname = request.getParameter("unitname")==null?"":request.getParameter("unitname");
  
  
  String item_62 = request.getParameter("Item_62")==null?"":request.getParameter("Item_62");
  
  
   String province = request.getParameter("province")==null?"":request.getParameter("province");
   String regmoney = request.getParameter("regmoney")==null?"":request.getParameter("regmoney");
       int regmoneyn = 0;   
          if (regmoney.trim().length()>0){
       regmoneyn = Integer.parseInt(regmoney);
         }
  
   String staffsum = request.getParameter("StaffSum")==null?"":request.getParameter("StaffSum");
   
    
   String salemoney = request.getParameter("salemoney")==null?"":request.getParameter("salemoney");
   
   int salemoneyn = 0;   
          if (salemoney.trim().length()>0){
         salemoneyn = Integer.parseInt(salemoney);
         }
   
   String unitintro = request.getParameter("unitintro")==null?"":request.getParameter("unitintro");
     
   String linkman = request.getParameter("linkman")==null?"":request.getParameter("linkman");
        
   String email = request.getParameter("email")==null?"":request.getParameter("email");
        
    String tel = request.getParameter("tel")==null?"":request.getParameter("tel");
   String fax = request.getParameter("fax")==null?"":request.getParameter("fax");
   String addr = request.getParameter("addr")==null?"":request.getParameter("addr");
      
   String zip = request.getParameter("zip")==null?"":tool.toCP(request.getParameter("zip"));
   String id = (String)IDGenerator.getIDGenerator("T_NeedForAchieve").getID(2);
   NeedObj = new NeedForAchieveVal(id,title,keywords,newenergyclass,item_16,needreasons,cooperates,planinvest,techsatus,techneed,needertype,unitname,item_62,province,regmoneyn,staffsum,salemoneyn,unitintro,addr,linkman,zip,tel,fax,email,"","0");
   results = needdao.addNeedForAchieve(NeedObj);
   if (results==true){%>
    	<script language='javascript'>
    		alert("您的需求提交成功，我们会尽快和您联系!");
    		location.href="<%=path%>/achieve/achieveIndex.jsp";
    	</script>
   <%}else {%>
   		<script language='javascript'>
   			alert("您的需求提交失败，请您稍后再试!");
   			location.href="<%=path%>/achieve/achieveIndex.jsp";
   		</script>
   	<%}
 %>